/* 基本样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

h1 {
    color: #2c3e50;
    font-size: 24px;
}

h2 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 20px;
}

h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

/* 状态指示器 */
#status-container {
    display: flex;
    align-items: center;
    font-size: 14px;
}

#api-status {
    margin-left: 5px;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: #f1c40f;
    color: #fff;
}

.config-link {
    margin-left: 15px;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    padding: 3px 8px;
    border: 1px solid #3498db;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.config-link:hover {
    background-color: #3498db;
    color: white;
}

#api-status.success {
    background-color: #2ecc71;
}

#api-status.error {
    background-color: #e74c3c;
}

/* 标签页 */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #7f8c8d;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #3498db;
}

.tab-btn.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

.tab-content {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

textarea, input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}

input[type="range"] {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* 结果容器 */
.result-container {
    margin-top: 20px;
}

.result {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    min-height: 150px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    overflow-x: auto;
}

.placeholder {
    color: #95a5a6;
    font-style: italic;
}

/* 聊天样式 */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 5px;
}

.user-message {
    align-self: flex-end;
    background-color: #3498db;
    color: white;
    border-bottom-right-radius: 5px;
}

.assistant-message {
    align-self: flex-start;
    background-color: #ecf0f1;
    color: #333;
    border-bottom-left-radius: 5px;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input textarea {
    flex-grow: 1;
}

.settings {
    margin-top: 10px;
    align-items: center;
}

/* API 信息 */
.api-info {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.api-request-info, .api-response-info {
    margin-bottom: 15px;
}

.request-header, .response-header {
    font-weight: bold;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.request-body, .response-body {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    overflow-x: auto;
}

pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* 图片上传和预览 */
.image-upload-container {
    position: relative;
    margin-bottom: 10px;
}

#image-preview-container {
    position: relative;
    margin-top: 10px;
    max-width: 100%;
    display: inline-block;
}

#image-preview-container.hidden {
    display: none;
}

#image-preview {
    max-width: 100%;
    max-height: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e74c3c;
    color: white;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .chat-input {
        flex-direction: column;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    #status-container {
        margin-top: 10px;
    }
}
